home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Tools & Goodies / IntlTest / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-04-23  |  4.5 KB  |  140 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Written by:            Mary Boetcher
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef CONTENT_H
  13. #define CONTENT_H
  14.  
  15. #ifndef DEFINES_K
  16. #include "Defines.k"
  17. #endif
  18.  
  19. // ----- Framework Includes -----
  20.  
  21. #ifndef FWCONTNT_H
  22. #include "FWContnt.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class CIntlTestPart;
  30. class FW_CEditView;
  31.  
  32. //========================================================================================
  33. //    class CIntlTestContent
  34. //========================================================================================
  35.  
  36. class CIntlTestContent : public FW_CContent
  37. {
  38.   public:
  39.     FW_DECLARE_AUTO(CIntlTestContent)
  40.     
  41.     CIntlTestContent(Environment* ev, CIntlTestPart* part);
  42.     virtual ~CIntlTestContent();
  43.  
  44.   public:
  45.     virtual void        Externalize(Environment* ev,
  46.                                     ODStorageUnit* storageUnit,
  47.                                     FW_EStorageKinds storageKind,
  48.                                     FW_CCloneInfo* cloneInfo);
  49.     virtual FW_Boolean    Internalize(Environment* ev,
  50.                                     ODStorageUnit* storageUnit, 
  51.                                     FW_EStorageKinds storageKind,
  52.                                     FW_CCloneInfo* cloneInfo);
  53.  
  54.     virtual ODShape*    CreateDataFrameShape(Environment* ev) const;
  55.  
  56. //----------------------------------------------------------------------------------------
  57. //    New Stuff
  58. //
  59.   public:
  60.     void        ExternalizePartKind(Environment* ev, ODStorageUnit* destinationSU);
  61.     void        ExternalizeIntlText(Environment* ev, ODStorageUnit* destinationSU);
  62.     void        ExternalizeText(Environment* ev, ODStorageUnit* destinationSU);
  63.  
  64.     FW_Boolean    InternalizePartKind(Environment* ev, ODStorageUnit* sourceSU);
  65.  
  66.     const FW_CString&    GetTextData(ODID whichView);
  67.     void                SetTextData(Environment* ev, const FW_CString& newText, ODID whichView);
  68.  
  69. //----------------------------------------------------------------------------------------
  70. //    Data Members
  71. //
  72.   protected:
  73.     FW_CString255        fEnglishText;
  74.     FW_CString            fJapaneseText;
  75.     FW_CString            fTextData;
  76.  
  77.     CIntlTestPart*        fIntlTestPart;
  78. };
  79.  
  80. //========================================================================================
  81. //    class CIntlTestSelectedContent
  82. //========================================================================================
  83.  
  84. class CIntlTestSelectedContent : public FW_CContent
  85. {
  86.   public:
  87.     FW_DECLARE_AUTO(CIntlTestSelectedContent)
  88.     
  89.     CIntlTestSelectedContent(Environment* ev, CIntlTestPart* part);
  90.     virtual ~CIntlTestSelectedContent();
  91.  
  92.   public:
  93.     virtual void        Externalize(Environment* ev,
  94.                                     ODStorageUnit* storageUnit,
  95.                                     FW_EStorageKinds storageKind,
  96.                                     FW_CCloneInfo* cloneInfo);
  97.     virtual FW_Boolean    Internalize(Environment* ev,
  98.                                     ODStorageUnit* storageUnit, 
  99.                                     FW_EStorageKinds storageKind,
  100.                                     FW_CCloneInfo* cloneInfo);
  101.  
  102. //----------------------------------------------------------------------------------------
  103. //    New Stuff
  104. //
  105.     FW_CString GetInternalizedText();
  106.     void GetSelectedText(Environment* ev, FW_CString& text);
  107.     void SetSelectedText(Environment* ev, const FW_CString& newText);
  108.     void ClearSelectedText(Environment* ev);
  109.     void SetSelectionRange(Environment* ev, short startOffset, short endOffset);
  110.     void SetEditView(FW_CEditView* editView);
  111.  
  112. //----------------------------------------------------------------------------------------
  113. //    Data Members
  114. //
  115.   protected:
  116.     CIntlTestPart*        fIntlTestPart;
  117.     FW_CEditView*        fEditView;            // selected edit view
  118.     FW_CString            fInternalizedText;    // holds text that was just internalized
  119. };
  120.  
  121. //----------------------------------------------------------------------------------------
  122. inline FW_CString CIntlTestSelectedContent::GetInternalizedText()
  123. {
  124.     return fInternalizedText;
  125. }
  126.  
  127. //----------------------------------------------------------------------------------------
  128. inline void CIntlTestSelectedContent::SetEditView(FW_CEditView* editView)
  129. {
  130.     fEditView = editView;
  131. }
  132.  
  133. //========================================================================================
  134. // Prototypes
  135. //========================================================================================
  136. FW_Boolean InternalizeIntlText(Environment* ev, ODStorageUnit* storageUnit, FW_CString& textData);
  137. FW_Boolean InternalizeText(Environment* ev, ODStorageUnit* storageUnit, FW_CString& textData);
  138.  
  139.  
  140. #endif